<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  	<base target="_self" /> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>修改用户</title>
	<script type="text/javascript">
	function tijiao(){
		
		var uname = document.getElementById('uname').value;
		var rname = document.getElementById('rname').value;
		var uphone = document.getElementById('phone').value;
		
		if(uname == '' || uname == null){
			alert("登录不能为空!");
			return false;
		}else if(rname == '' || rname == null){
			alert("姓名不能为空!");
			return false;
		}else if(uphone == null || uphone == ''){
			alert("电话不能为空!");
			return false;
		}else{
			return true;
		}
	}
	</script>
  </head>
  
  <body>
    <form action="<%=basePath %>sys/user_updateUser.action" id="form1" method="post">
	<font color="red">${message }</font>
	<table width="600" border="1" cellspacing="0" cellpadding="5" align="center" class="EnterBorder">
		<tr>
			<td class="tabTitle" colspan="6" height="31">修改用户</td>
		</tr>
    	<tr>
    		<td align="right">登&nbsp;&nbsp;录&nbsp;&nbsp;名</td>
    		<td><input type="text" name="user.uname" id="uname" value="<s:property value="%{user.uname}" />" /></td>
    	</tr>
  		<tr>
    		<td align="right">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</td>
    		<td><input type="text" name="user.rname" id="rname" value="<s:property value="%{user.rname}" />" /></td> 
    	</tr>
    	<tr>
    		<td align="right">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</td>
    		<td>
    			<input type="radio" name="user.sex" id="sex" value="1" <s:if test="%{user.sex == 1}">checked</s:if> />男&nbsp;&nbsp;
    			<input type="radio" name="user.sex" id="sex" value="2" <s:if test="%{user.sex == 2}">checked</s:if> />女&nbsp;&nbsp;
    		</td> 
    	</tr>
    	<tr>
    		<td align="right">状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态</td>
    		<td>
    			<input type="radio" name="user.state" id="state" value="1" <s:if test="%{user.state == 1}">checked</s:if> />启用&nbsp;&nbsp;
    			<input type="radio" name="user.state" id="state" value="2" <s:if test="%{user.state == 2}">checked</s:if> />停用&nbsp;&nbsp;
    		</td> 
    	</tr>
    	<tr>
    		<td align="right">手&nbsp;&nbsp;机&nbsp;&nbsp;号</td>
    		<td><input type="text" name="user.phone" id="phone" value="<s:property value="%{user.phone}" />" /></td> 
    	</tr>
    	<tr>
    		<td align="right">邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱</td>
    		<td><input type="text" name="user.email" id="email" value="<s:property value="%{user.email}" />" /></td> 
    	</tr>
    	<tr>
    		<td align="right">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</td>
    		<td><input type="text" name="user.remark" id="remark" value="<s:property value="%{user.remark}" />" /></td> 
    	</tr>
  		<tr>
    		<td>&nbsp;
    			<input type="hidden" name="user.code" value="" />
    			<input type="hidden" name="user.id" value="<s:property value="%{user.id}" />" />
    		</td>
    		<td colspan="5">
    			<input name="input" type="submit" value="提交" onclick="return tijiao();" />
    		</td>
  		</tr>
	</table>
	</form>
  </body>
</html>
